<template>
  <div class="modify-dialog">
    <slot> </slot>
    <el-dialog v-bind="dialogOpts" :visible.sync="dialogVisible">
      <Form v-bind="formOpts" v-on="formEvent">
        <template #formBtn>
          <div class="dialog-footer">
            <el-button @click="dialogVisible = false">取 消</el-button>
            <el-button type="primary" @click="onConfirm"> 确 定 </el-button>
          </div>
        </template>
      </Form>
    </el-dialog>
  </div>
</template>

<script>
import modifyMixins from "@/mixins/modifyMixins.vue";
export default {
  mixins: [modifyMixins],
  data() {
    return {
      dialogTitle: "出库",
      form: {
        outVouchers: {
          tag: "Uploader",
          label: "出库凭证",
          value: [],
          props: {},
        },
      },
    };
  },
  methods: {
    onSubmit(form) {
      const { modify, row } = this;
      form.outVouchers = form.outVouchers.join(",");
      form.type = row.type;
      form.targetId = row.targetId;
      if (modify === "modifyInOutInventory")
        this.$api["materialTransferMaterialTransferOut"](form).then(this.submitDoneMsg);
    },
  },
};
</script>

<style lang="less" scoped></style>
